﻿using System;


namespace Having.Site.Data
{
    /// <summary>
    /// 配置
    /// </summary>
    public class Config
    {
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectStr { set; get; }
        /// <summary>
        /// 类型(SQL/Access)
        /// </summary>
        public SQLType Datatype { set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_ConnectStr">连接字符串</param>
        /// <param name="_Datatype">类型(MSSQL/ACCESS/SQLITE/MYSQL/ORACLE)</param>
        public Config(string _ConnectStr=null, string _Datatype= "MSSQL")
        {
            this.ConnectStr = _ConnectStr;
            this.Datatype = (SQLType)Enum.Parse(typeof(SQLType), _Datatype);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_ConnectStr"></param>
        /// <param name="_Datatype"></param>
        public Config(string _ConnectStr = null, SQLType _Datatype = SQLType.MSSQL)
        {
            this.ConnectStr = _ConnectStr;
            this.Datatype = _Datatype;
        }

    }
}
